<include file="Public/head" title="订单支付"/>
<include file="Public/back_head"/>
<div class="main">
    <div class="Pay">
        <div class="pay_money">
            <span>订单金额</span>
            <span><i class="iconfont icon-jiage-copy"></i>{$order_info.order_price}</span>
        </div>
        
        <if condition="$order_info.service eq '1'">
        <!-- 普通订单支付 -->
        <div class="pay_btn">立即支付</div>
        <!-- 普通订单支付  -->
        </if>
        
        <if condition="$order_info.service eq '2'">
        <!-- VIP支付 -->
        <div class="pay_type Margin_Top">
            <div class="title">已选服务 <span>Vip通道</span></div>
            <div class="show">车身个性雕刻 <span>{$order_info.vip_note}</span></div>
        </div>
        <div class="pay_btn">立即支付</div>
        <!-- VIP支付 -->
        </if>
        
        <if condition="$order_info.service eq '3'">
        <!-- 按天付 -->
        <div class="pay_type_day">
            <div class="list eq1">已选服务 <span>按天支付</span></div>
            <div class="list eq2">每天还款 <span>￥{$goods_info.per_price|default=0}</span></div>
            <div class="list eq3">还款天数 <span>{$goods_info.per_days|default=0}天</span></div>
            <div class="Notes"><i class="iconfont icon-zhuyi"></i>按天付专享免息福利，每天还款为账户余额自动扣款。</div>
        </div>
        <div class="pay_money">
            <span>押金</span>
            <span>￥{$order_info.deposit|default=0}</span>
            <div class="Notes"><i class="iconfont icon-zhuyi"></i>使用按天付需缴纳一定押金，还款结束后会退给您。</div>
        </div>
        <div class="pay_btn">支付押金和首付</div>
        <!-- 按天付 -->
        </if>
        
        <div class="pay_rules"><i class="iconfont icon-fangkuaidagou-xuanzhong"></i>付款即默认接受条款</div>
    </div>
</div>
<include file="Public/payapi"/>
<script type="text/javascript">
    (function () {
        $('.pay_btn').one('click',function(data){
			var url = '{:U("Pay/pay_order")}';
			var total_fee = '{$order_info.order_price}';
			to_pay(url,total_fee,function(res){
				if(res.errMsg == "chooseWXPay:ok" ) {
				   layer.msg('支付成功！');
				   location.href="{:U('Order/pay_back')}";
				}else{
					layer.msg('支付失败！');
					window.location.reload();
				}
			});
			return false;
		});
    })(jQuery)
</script>
<include file="Public/foot"/>